/**
int f(int n)
{
    int ans=0;

    while(n>0)
    {
        ans+=n%10;
        n/=10;
    }

    return ans;
}
*/
int f(int n)
{
   //if(n==0)return 1;//fixed bug 10012
   //return (int)(log10(n))+1;
    if(n<10)return 1;
    return f(n/10)+1;
}

int main()
{
    printf("%d\n",5==f(12345));
    printf("%d\n",1==f(0));
    printf("%d\n",1==f(1));
    printf("%d\n",3==f(123));

    return 0;
}
